/* Modal主题适配样式 */

/* 重要：确保模态框样式优先级足够高 */
.ant-modal .ant-modal-header {
  transition: background-color 0.3s ease, border-color 0.3s ease !important;
}

.ant-modal .ant-modal-title {
  transition: color 0.3s ease !important;
}

.ant-modal .ant-modal-content {
  transition: background-color 0.3s ease, box-shadow 0.3s ease !important;
}

.ant-modal .ant-modal-body {
  transition: background-color 0.3s ease, color 0.3s ease !important;
}

.ant-modal .ant-modal-footer {
  transition: background-color 0.3s ease, border-color 0.3s ease !important;
}

/* 浅色主题 - 极简现代 */
body.light-theme .ant-modal .ant-modal-header,
body:not(.dark-theme):not(.purple-theme):not(.green-theme):not(.tech-theme) .ant-modal .ant-modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e5e5ea !important;
  border-radius: 16px 16px 0 0 !important;
}

body.light-theme .ant-modal .ant-modal-title,
body:not(.dark-theme):not(.purple-theme):not(.green-theme):not(.tech-theme) .ant-modal .ant-modal-title {
  color: #000000 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif !important;
}

body.light-theme .ant-modal .ant-modal-content,
body:not(.dark-theme):not(.purple-theme):not(.green-theme):not(.tech-theme) .ant-modal .ant-modal-content {
  background: #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.23) !important;
}

body.light-theme .ant-modal .ant-modal-body,
body:not(.dark-theme):not(.purple-theme):not(.green-theme):not(.tech-theme) .ant-modal .ant-modal-body {
  background: #ffffff !important;
  color: #000000 !important;
}

body.light-theme .ant-modal .ant-modal-footer,
body:not(.dark-theme):not(.purple-theme):not(.green-theme):not(.tech-theme) .ant-modal .ant-modal-footer {
  background: #ffffff !important;
  border-top: 1px solid #e5e5ea !important;
  border-radius: 0 0 16px 16px !important;
}

/* 深色主题 - 专业深色 */
body.dark-theme .ant-modal .ant-modal-header {
  background: #1e293b !important;
  border-bottom: 1px solid #475569 !important;
  border-radius: 12px 12px 0 0 !important;
}

body.dark-theme .ant-modal .ant-modal-title {
  color: #f1f5f9 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif !important;
}

body.dark-theme .ant-modal .ant-modal-content {
  background: #1e293b !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

body.dark-theme .ant-modal .ant-modal-body {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}

body.dark-theme .ant-modal .ant-modal-footer {
  background: #1e293b !important;
  border-top: 1px solid #475569 !important;
  border-radius: 0 0 12px 12px !important;
}

body.dark-theme .ant-modal .ant-modal-close {
  color: #cbd5e1 !important;
}

body.dark-theme .ant-modal .ant-modal-close:hover {
  color: #f1f5f9 !important;
}

/* 新拟物主题 - 立体质感（美化版） */
body.purple-theme .ant-modal .ant-modal-header {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border-bottom: none !important;
  border-radius: 28px 28px 0 0 !important;
  box-shadow: inset 1px 1px 2px #d1d9e6, inset -1px -1px 2px #ffffff, 0 0 0 1px rgba(255, 255, 255, 0.8) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* 模态框头部装饰 */
body.purple-theme .ant-modal .ant-modal-header::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.02) 100%) !important;
  pointer-events: none !important;
}

body.purple-theme .ant-modal .ant-modal-title {
  color: #1e293b !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
  position: relative !important;
  z-index: 1 !important;
}

body.purple-theme .ant-modal .ant-modal-content {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-radius: 28px !important;
  box-shadow: 10px 10px 20px #c8d0dc, -10px -10px 20px #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.9) !important;
  border: none !important;
  position: relative !important;
  overflow: hidden !important;
}

/* 模态框内容装饰 */
body.purple-theme .ant-modal .ant-modal-content::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

body.purple-theme .ant-modal .ant-modal-body {
  background: transparent !important;
  color: #1e293b !important;
  position: relative !important;
  z-index: 1 !important;
}

body.purple-theme .ant-modal .ant-modal-footer {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
  border-top: none !important;
  border-radius: 0 0 28px 28px !important;
  box-shadow: inset 1px -1px 2px #d1d9e6, inset -1px 1px 2px #ffffff, 0 0 0 1px rgba(255, 255, 255, 0.8) !important;
  position: relative !important;
  z-index: 1 !important;
}

body.purple-theme .ant-modal .ant-modal-close {
  color: #64748b !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  z-index: 2 !important;
}

body.purple-theme .ant-modal .ant-modal-close:hover {
  color: #1e293b !important;
  background: rgba(255, 255, 255, 0.8) !important;
  border-radius: 50% !important;
}

/* 自然绿色主题 */
body.green-theme .ant-modal .ant-modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid #dcfce7 !important;
  border-radius: 12px 12px 0 0 !important;
}

body.green-theme .ant-modal .ant-modal-title {
  color: #064e3b !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif !important;
}

body.green-theme .ant-modal .ant-modal-content {
  background: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.1), 0 2px 4px -1px rgba(5, 150, 105, 0.06) !important;
}

body.green-theme .ant-modal .ant-modal-body {
  background: #ffffff !important;
  color: #064e3b !important;
}

body.green-theme .ant-modal .ant-modal-footer {
  background: #ffffff !important;
  border-top: 1px solid #dcfce7 !important;
  border-radius: 0 0 12px 12px !important;
}

body.green-theme .ant-modal .ant-modal-close {
  color: #6b7280 !important;
}

body.green-theme .ant-modal .ant-modal-close:hover {
  color: #059669 !important;
}

/* 科技蓝主题 */
body.tech-theme .ant-modal .ant-modal-header {
  background: #0f1419 !important;
  border-bottom: 1px solid #2d3748 !important;
  border-radius: 8px 8px 0 0 !important;
}

body.tech-theme .ant-modal .ant-modal-title {
  color: #e2e8f0 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Inter", sans-serif !important;
}

body.tech-theme .ant-modal .ant-modal-content {
  background: #0f1419 !important;
  border-radius: 8px !important;
  box-shadow: 0 0 30px rgba(14, 165, 233, 0.4), 0 8px 16px rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
}

body.tech-theme .ant-modal .ant-modal-body {
  background: #0f1419 !important;
  color: #e2e8f0 !important;
}

body.tech-theme .ant-modal .ant-modal-footer {
  background: #0f1419 !important;
  border-top: 1px solid #2d3748 !important;
  border-radius: 0 0 8px 8px !important;
}

body.tech-theme .ant-modal .ant-modal-close {
  color: #a0aec0 !important;
}

body.tech-theme .ant-modal .ant-modal-close:hover {
  color: #0ea5e9 !important;
}

/* 模态框遮罩层主题适配 */
body.dark-theme .ant-modal-mask,
body.tech-theme .ant-modal-mask {
  background-color: rgba(0, 0, 0, 0.6) !important;
}

body.light-theme .ant-modal-mask,
body:not(.dark-theme):not(.purple-theme):not(.green-theme):not(.tech-theme) .ant-modal-mask {
  background-color: rgba(0, 0, 0, 0.45) !important;
}

body.purple-theme .ant-modal-mask {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.3) 0%, rgba(99, 102, 241, 0.2) 100%) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

body.green-theme .ant-modal-mask {
  background-color: rgba(0, 0, 0, 0.45) !important;
}

/* 模态框输入框和表单元素主题适配 */
body.dark-theme .ant-modal .ant-input,
body.tech-theme .ant-modal .ant-input {
  background-color: rgba(51, 65, 85, 0.5) !important;
  border-color: rgba(71, 85, 105, 0.8) !important;
  color: #f1f5f9 !important;
}

body.dark-theme .ant-modal .ant-input:focus,
body.tech-theme .ant-modal .ant-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

body.dark-theme .ant-modal .ant-select-selector,
body.tech-theme .ant-modal .ant-select-selector {
  background-color: rgba(51, 65, 85, 0.5) !important;
  border-color: rgba(71, 85, 105, 0.8) !important;
  color: #f1f5f9 !important;
}

body.dark-theme .ant-modal .ant-form-item-label > label,
body.tech-theme .ant-modal .ant-form-item-label > label {
  color: #f1f5f9 !important;
}

/* 新拟物主题表单元素（美化版） */
body.purple-theme .ant-modal .ant-input,
body.purple-theme .ant-modal .ant-input-affix-wrapper,
body.purple-theme .ant-modal .ant-select-selector {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border: none !important;
  box-shadow: inset 2px 2px 4px #d1d9e6, inset -2px -2px 4px #ffffff, 0 0 0 1px rgba(255, 255, 255, 0.8) !important;
  color: #1e293b !important;
  border-radius: 16px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body.purple-theme .ant-modal .ant-input:focus,
body.purple-theme .ant-modal .ant-input-affix-wrapper:focus,
body.purple-theme .ant-modal .ant-input-affix-wrapper-focused,
body.purple-theme .ant-modal .ant-select-focused .ant-select-selector {
  box-shadow: inset 3px 3px 6px #c8d0dc, inset -3px -3px 6px #ffffff, 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%) !important;
}

body.purple-theme .ant-modal .ant-form-item-label > label {
  color: #1e293b !important;
  font-weight: 500 !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

/* 模态框按钮样式 */
body.purple-theme .ant-modal .ant-btn {
  box-shadow: 3px 3px 6px #d1d9e6, -3px -3px 6px #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.8) !important;
}

body.purple-theme .ant-modal .ant-btn:hover {
  box-shadow: 4px 4px 8px #c8d0dc, -4px -4px 8px #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.9) !important;
}

/* 自然绿主题表单元素 */
body.green-theme .ant-modal .ant-input {
  background-color: #ffffff !important;
  border-color: #dcfce7 !important;
  color: #064e3b !important;
}

body.green-theme .ant-modal .ant-input:focus {
  border-color: #059669 !important;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2) !important;
}

body.green-theme .ant-modal .ant-form-item-label > label {
  color: #064e3b !important;
}

[data-theme="tech"] .ant-modal .ant-modal-title {
  color: #e2e8f0;
  font-size: 16px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Inter", sans-serif;
}

[data-theme="tech"] .ant-modal .ant-modal-content {
  background: #0f1419;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.2), 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(14, 165, 233, 0.1);
}

[data-theme="tech"] .ant-modal .ant-modal-body {
  background: #0f1419;
  color: #e2e8f0;
}

[data-theme="tech"] .ant-modal .ant-modal-footer {
  background: #0f1419;
  border-top: 1px solid #2d3748;
  border-radius: 0 0 8px 8px;
}

[data-theme="tech"] .ant-modal .ant-modal-close {
  color: #a0aec0;
}

[data-theme="tech"] .ant-modal .ant-modal-close:hover {
  color: #0ea5e9;
}

/* 通用样式优化 */
.ant-modal .ant-modal-header {
  padding: 16px 24px;
}

.ant-modal .ant-modal-title {
  line-height: 1.4;
  margin: 0;
}

.ant-modal .ant-modal-body {
  padding: 24px;
}

.ant-modal .ant-modal-footer {
  padding: 16px 24px;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .ant-modal .ant-modal-header {
    padding: 12px 16px;
  }
  
  .ant-modal .ant-modal-body {
    padding: 16px;
  }
  
  .ant-modal .ant-modal-footer {
    padding: 12px 16px;
  }
  
  .ant-modal .ant-modal-title {
    font-size: 16px;
  }
}

/* 确保Modal在不同主题下的文本可读性 */
.ant-modal .ant-form-item-label > label {
  color: inherit;
}

.ant-modal .ant-typography {
  color: inherit;
}

.ant-modal .ant-input,
.ant-modal .ant-select-selector,
.ant-modal .ant-picker {
  background-color: var(--ant-color-bg-container);
  border-color: var(--ant-color-border);
  color: var(--ant-color-text);
}

.ant-modal .ant-input:focus,
.ant-modal .ant-select-focused .ant-select-selector,
.ant-modal .ant-picker:focus {
  border-color: var(--ant-color-primary);
  box-shadow: 0 0 0 2px var(--ant-color-primary-bg);
}
